1. Field of the Invention
The present invention relates to a numerical controller that controls a three-axis machine tool, which machines a workpiece (an object to be machined) mounted on a table with at least three linear axes, and more particularly, to a numerical controller having a workpiece mounting error compensation unit for a three-axis machine tool that compensates a mounting error caused when a workpiece is mounted.
2. Description of the Related Art
A jig for fixing a workpiece on a table is used in order to facilitate a machining with a use of a machine tool. In this case, a workpiece mounting error (offset) is caused with respect to the machine tool because of the usage of the jig or the tilt of the table. The mounting error described above has to be compensated.
For example, Japanese patent documents described below describe techniques for compensating a mounting error of the workpiece with respect to the table when the workpiece mounted on the table is machined.
Japanese Patent Application Laid-Open No. 7-299697 describes the afore-mentioned technique of compensating the mounting error. This technique relates to a compensation method of a mounting error of a workpiece in a numerical controller that performs a simultaneous five-axis control of a tool with respect to a workpiece mounted on a jig. In this method, the position and direction of the tool in a coordinate system of the workpiece are determined based on a numerical instruction. An error compensation of an amount set beforehand is made with respect to the respective positions and directions, and coordinate values of five axes satisfying the position and direction of the tool, which are obtained as a result of the error compensation, are obtained. And, based on the obtained coordinate value of five axes, an instruction of a numerical control is issued to a drive unit of each axis.
Japanese Patent Application Laid-Open No. 2009-15464 describes a numerical controller that performs an interpolation with the coordinate values before execution of error compensation so as to attain a machining result similar to the result to be attained if there is no error, when there is an error between a position of a workpiece assumed by a machining program and an actual position of the workpiece and the workpiece rotates during the machining, and then performs an error compensation for the positions obtained by execution of interpolation for every interpolation point.
Japanese Patent Application Laid-Open No. 2009-93269 discloses a numerical controller that controls a five-axis machine tool which machines a workpiece mounted on a table with three linear axes and two rotary axes, and more particularly discloses a numerical controller which comprises a workpiece mounting error compensation unit for compensating a mounting error caused when the workpiece is mounted.
The techniques described in the above-mentioned three patent documents are applied to a numerical controller controlling a five-axis machine tool that has linear axes and rotary axes and that can control a direction of a tool to the workpiece. Specifically, these techniques aim to retain the position and direction of a tool with respect to a workpiece based on an original instruction by compensating the position and direction of the tool with respect to the workpiece in order to compensate the mounting error of the workpiece.
On the other hand, in a three-axis machine tool having at least three linear axes, a direction of a tool cannot be compensated, but it is desirable to compensate a position of a tool center point that is a machining point. In this case, the methods described in the above-mentioned patent documents, which are applicable to a five-axis machine tool that can control a direction of a tool, are compensation methods assumed to allow the direction of the tool to be compensated, as shown in FIGS. 1 and 2 that represent the related art of numerical control. Therefore, these methods cannot be applied to a three-axis machine tool.
In the patent documents described above that are applied to a five-axis machine tool, when there is a rotation error (β) about an Y axis at a position of a workpiece as illustrated in FIG. 1, for example, a compensation for the rotation error (β) with respect to a tool reference point position (Xc, Yc, Zc)T and an instructed tool direction (Ic, Jc, Kc)T are calculated as in an equation (1) described below, whereby a compensated tool reference point position (Xa, Ya, Za)T and a compensated tool direction (Ia, Ja, Ka)T are obtained. Then, a compensated rotary axis position is obtained as a rotary axis position (position of A, B, or C axis) for realizing the obtained compensated tool direction (Ia, Ja, Ka)T. The X, Y, and Z axes are driven to the compensated tool reference point position (Xa, Ya, Za)T, while the rotary axis (A, B, or C axis) is driven to the compensated rotary axis position, whereby the position (compensated reference point position) and the direction of the tool with respect to an actual workpiece position are compensated. Accordingly, the position and direction of the tool with respect to the workpiece based on the original instruction are retained. “T” described herein represents transposition. However, “T” will not be particularly described when the transposition is obvious.
                              [                                                                      X                  ⁢                                                                          ⁢                  a                                                                                                      Y                  ⁢                                                                          ⁢                  a                                                                                                      Z                  ⁢                                                                          ⁢                  a                                                              ]                =                                                            [                                                                                                    cos                        ⁢                                                                                                  ⁢                        β                                                                                    0                                                                                      sin                        ⁢                                                                                                  ⁢                        β                                                                                                                        0                                                              1                                                              0                                                                                                                                                    -                          sin                                                ⁢                                                                                                  ⁢                        β                                                                                    0                                                                                      cos                        ⁢                                                                                                  ⁢                        β                                                                                            ]                            ⁡                              [                                                                                                    X                        ⁢                                                                                                  ⁢                        c                                                                                                                                                Y                        ⁢                                                                                                  ⁢                        c                                                                                                                                                Z                        ⁢                                                                                                  ⁢                        c                                                                                            ]                                      ⁢                                                  [                                                                                I                    ⁢                                                                                  ⁢                    a                                                                                                                    J                    ⁢                                                                                  ⁢                    a                                                                                                                    K                    ⁢                                                                                  ⁢                    a                                                                        ]                    =                                    [                                                                                          cos                      ⁢                                                                                          ⁢                      β                                                                            0                                                                              sin                      ⁢                                                                                          ⁢                      β                                                                                                            0                                                        1                                                        0                                                                                                                                      -                        sin                                            ⁢                                                                                          ⁢                      β                                                                            0                                                                              cos                      ⁢                                                                                          ⁢                      β                                                                                  ]                        ⁡                          [                                                                                          I                      ⁢                                                                                          ⁢                      c                                                                                                                                  J                      ⁢                                                                                          ⁢                      c                                                                                                                                  K                      ⁢                                                                                          ⁢                      c                                                                                  ]                                                          (        1        )            
The matrix at the right side is only a matrix relating to β in a product of matrices of a rotation error (α) about an X axis, a rotation error (β) about a Y axis, and a rotation error (γ) about a Z axis in an equation (2) described below. In FIGS. 1 and 2, the case in which the workpiece is located at the actual position due to the rotation error (β) about the Y axis with respect to the reference workpiece position where respective sides of a rectangular-solid workpiece are parallel to the X, Y, and Z axes is indicated by a X-Z plane. β is actually a small value, but it is exaggeratingly illustrated in the figures.
                                          [                                                                                cos                    ⁢                                                                                  ⁢                    γ                                                                                                              -                      sin                                        ⁢                                                                                  ⁢                    γ                                                                    0                                                                                                  sin                    ⁢                                                                                  ⁢                    γ                                                                                        cos                    ⁢                                                                                  ⁢                    γ                                                                    0                                                                              0                                                  0                                                  1                                                      ]                    ⁡                      [                                                                                cos                    ⁢                                                                                  ⁢                    β                                                                    0                                                                      sin                    ⁢                                                                                  ⁢                    β                                                                                                0                                                  1                                                  0                                                                                                                        -                      sin                                        ⁢                                                                                  ⁢                    β                                                                    0                                                                      cos                    ⁢                                                                                  ⁢                    β                                                                        ]                          ⁡                  [                                                    1                                            0                                            0                                                                    0                                                              cos                  ⁢                                                                          ⁢                  α                                                                                                  -                    sin                                    ⁢                                                                          ⁢                  α                                                                                    0                                                              sin                  ⁢                                                                          ⁢                  α                                                                              cos                  ⁢                                                                          ⁢                  α                                                              ]                                    (        2        )            
However, since the three-axis machine tool has no rotary axis, the direction of the tool cannot be compensated. Specifically, the calculation of (Ia, Ja, Ka) in the equation (1) is not carried out. As a result, the relationship between the actual workpiece position and the compensated tool center point position is different from the relationship between the reference workpiece position and the tool center point position as illustrated in FIG. 2. This is because the numerical controller controls the tool reference point position in FIG. 2 as drive positions of three linear axes. Specifically, when the calculation of the equation (1) is made for the rotation error (β) with respect to the tool reference point position (Xc, Yc, Zc) so as to obtain the compensated tool reference point position (Xa, Ya, Za), the corresponding compensated tool center point position does not become a correct position with respect to the actual workpiece position. This is because the relationship between the actual workpiece position and the compensated tool center point position could not be the same as the relationship between the reference workpiece position and the tool center point position only by the calculation for the tool reference point position (Xc, Yc, Zc).
Japanese Patent Application Laid-Open No. 2009-15464, mentioned above, describes “in a three-axis machine tool having no rotary axis, a rotation angle of a workpiece is not changed during machining of the workpiece, so that the mounting error is not changed by the rotation. Therefore, the mounting error can be compensated by setting a workpiece offset or by using a three-dimensional coordinate conversion function” (see paragraph number [0003]). This suggests that a translational error can be compensated by setting a workpiece offset, but a rotation error cannot accurately be compensated by the three-dimensional coordinate conversion function. This is because the matrix calculation in the equation (2) or (1) is three-dimensional coordinate conversion, and precise compensation could not be attained, as described above, even if these calculations are applied to the three-axis machine tool.
Therefore, in the case of three-axis machine tool, a correct machining at a compensated tool center point position could not be made by the conventional technique such as the method of applying the compensation of the mounting error of the workpiece in the five-axis machine tool to the three-axis machine tool, or the method of using the three-dimensional coordinate conversion function as described in Japanese Patent Application Laid-Open No. 2009-15464, mentioned above.